<template>
  <div id="app">
    <div class="loading-overlay" ref="loading" v-show="isLoading">
      <div class="loading-content">加载中...</div>
    </div>
    <router-view />
  </div>
</template>

<script setup>
import { ref } from "vue";

const isLoading = ref(false); // 控制加载动画显示与隐藏
</script>

<style scoped>
.loading-overlay {
  display: none;  /* 初始隐藏 */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);  /* 半透明背景 */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;  /* 确保显示在最上层 */
}

.loading-content {
  font-size: 24px;
  color: white;
  font-weight: bold;
}

</style>
